const mysql = require('mysql')

const con = mysql.createPool({
  host: 'localhost',
  user: 'root',
  password: '3051532wyp.',
  database: 's_1712A'
})

const exec = (sql, arr) => {
  return new Promise((resolve, reject) => {
    con.query(sql, arr, (err, data) => {
      if (err) reject(err)
      resolve(data)
    })
  })
}

module.exports = {
  exec
}